package com.wtwd.device.controller;

import com.wtwd.device.model.entity.HeartRateList;
import com.wtwd.device.model.vo.RespEntity;
import com.wtwd.device.service.HeartRateListService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "心率列表值")
@RestController
@RequestMapping("/heart-rate-list")
public class HeartRateListController {
    @Autowired
    private HeartRateListService heartRateListService;



    @ApiOperation(value = "获取心率列表值", notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "type", value = "类型 1-高心率 2-低心率 3-运动心率 不填默认查所有数据", dataType = "int")
    })
    @RequestMapping(value = "/getHeartRateList" , method = RequestMethod.GET)
    public RespEntity getHeartRateList(@RequestParam(value = "type",defaultValue = "") Byte type){
        List<HeartRateList> heartRateList = heartRateListService.getHeartRateList(type);
        return RespEntity.success(heartRateList);
    }
}
